package com.nantian.common.secret.asymmetric;

import com.nantian.common.secret.Base64Utils;

/**
 * <p>ClassName: KeyPairManagement</p >
 * <p>Description: RSA算法密钥对管理</p >
 * <p>Copyright: Copyright©2014</p >
 * <p>Company: 广州南天电脑系统有限公司</p >
 * <p>Date: 2020-12-21</p >
 *
 * @author 刘晓辉
 * @version 1.0
 */
public class KeyPairManagement {
    /**
     * 公钥
     */
    private byte[] publicKey;
    /**
     * 私钥
     */
    private byte[] privateKey;

    public byte[] getPublicKey() {
        return publicKey.clone();
    }

    public void setPublicKey(byte[] publicKey) {
        this.publicKey = publicKey.clone();
    }

    public byte[] getPrivateKey() {
        return this.privateKey.clone();
    }

    public void setPrivateKey(byte[] privateKey) {
        this.privateKey = privateKey.clone();
    }

    public String getPubliceKeyBase64() {
        return Base64Utils.encode(this.publicKey);
    }

    public String getPrivateKeyBase64() {
        return Base64Utils.encode(this.privateKey);
    }
}
